package com.woniuxy.dudugua.service.impl;

import com.woniuxy.dudugua.entity.ProductImages;
import com.woniuxy.dudugua.entity.ProductImagesExample;
import com.woniuxy.dudugua.mapper.ProductImagesMapper;
import com.woniuxy.dudugua.service.ProductImagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class ProductImagesServiceImpl implements ProductImagesService {
    @Autowired
    private ProductImagesMapper productImagesMapper;
    @Override
    public int insert(ProductImages productImages) {
        int insert = productImagesMapper.insert(productImages);
        return insert;
    }

    @Override
    public List<ProductImages> selectById(Integer productId) {
        ProductImagesExample example = new ProductImagesExample();
        ProductImagesExample.Criteria criteria = example.createCriteria();
        criteria.andProductIdEqualTo(productId);
        return productImagesMapper.selectByExample(example);
    }
}
